DROP TABLE CRST_AR_CASH_RECEIPT_HISTORY;  
  
CREATE TABLE CRST_AR_CASH_RECEIPT_HISTORY                                                                                                                     
(                                                                                                                                                            
  CASH_RECEIPT_HISTORY_ID        NUMBER(15)     NOT NULL,                                                                                                    
  CASH_RECEIPT_ID                NUMBER(15)     NOT NULL,                                                                                                    
  STATUS                         VARCHAR2(30 BYTE) NOT NULL,                                                                                                 
  TRX_DATE                       DATE           NOT NULL,                                                                                                    
  AMOUNT                         NUMBER         NOT NULL,                                                                                                    
  FIRST_POSTED_RECORD_FLAG       VARCHAR2(1 BYTE) NOT NULL,                                                                                                  
  POSTABLE_FLAG                  VARCHAR2(1 BYTE) NOT NULL,                                                                                                  
  FACTOR_FLAG                    VARCHAR2(1 BYTE) NOT NULL,                                                                                                  
  GL_DATE                        DATE           NOT NULL,                                                                                                    
  CURRENT_RECORD_FLAG            VARCHAR2(1 BYTE),                                                                                                           
  BATCH_ID                       NUMBER(15),                                                                                                                 
  ACCOUNT_CODE_COMBINATION_ID    NUMBER(15),                                                                                                                 
  REVERSAL_GL_DATE               DATE,                                                                                                                       
  REVERSAL_CASH_RECEIPT_HIST_ID  NUMBER(15),                                                                                                                 
  FACTOR_DISCOUNT_AMOUNT         NUMBER,                                                                                                                     
  BANK_CHARGE_ACCOUNT_CCID       NUMBER(15),                                                                                                                 
  POSTING_CONTROL_ID             NUMBER(15)     DEFAULT -3  NOT NULL,                                                                      
  REVERSAL_POSTING_CONTROL_ID    NUMBER(15),                                                                                                                 
  GL_POSTED_DATE                 DATE,                                                                                                                       
  REVERSAL_GL_POSTED_DATE        DATE,                                                                                                                       
  LAST_UPDATE_LOGIN              NUMBER(15),                                                                                                                 
  ACCTD_AMOUNT                   NUMBER         NOT NULL,                                                                                                    
  ACCTD_FACTOR_DISCOUNT_AMOUNT   NUMBER,                                                                                                                     
  CREATED_BY                     NUMBER(15)     NOT NULL,                                                                                                    
  CREATION_DATE                  DATE           NOT NULL,                                                                                                    
  EXCHANGE_DATE                  DATE,                                                                                                                       
  EXCHANGE_RATE                  NUMBER,                                                                                                                     
  EXCHANGE_RATE_TYPE             VARCHAR2(30 BYTE),                                                                                                          
  LAST_UPDATE_DATE               DATE           NOT NULL,                                                                                                    
  PROGRAM_APPLICATION_ID         NUMBER(15),                                                                                                                 
  PROGRAM_ID                     NUMBER(15),                                                                                                                 
  PROGRAM_UPDATE_DATE            DATE,                                                                                                                       
  REQUEST_ID                     NUMBER(15),                                                                                                                 
  LAST_UPDATED_BY                NUMBER(15)     NOT NULL,                                                                                                    
  PRV_STAT_CASH_RECEIPT_HIST_ID  NUMBER(15),                                                                                                                 
  CREATED_FROM                   VARCHAR2(30 BYTE) NOT NULL,                                                                                                 
  REVERSAL_CREATED_FROM          VARCHAR2(30 BYTE),                                                                                                          
  ATTRIBUTE1                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE2                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE3                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE4                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE5                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE6                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE7                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE8                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE9                     VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE10                    VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE11                    VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE12                    VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE13                    VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE14                    VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE15                    VARCHAR2(150 BYTE),                                                                                                         
  ATTRIBUTE_CATEGORY             VARCHAR2(30 BYTE),                                                                                                          
  NOTE_STATUS                    VARCHAR2(30 BYTE),                                                                                                          
  ORG_ID                         NUMBER(15),
  MRC_POSTING_CONTROL_ID         VARCHAR2(2000 BYTE),                                                                                                        
  MRC_GL_POSTED_DATE             VARCHAR2(2000 BYTE),                                                                                                        
  MRC_REVERSAL_GL_POSTED_DATE    VARCHAR2(2000 BYTE),                                                                                                        
  MRC_ACCTD_AMOUNT               VARCHAR2(2000 BYTE),                                                                                                        
  MRC_ACCTD_FACTOR_DISC_AMOUNT   VARCHAR2(2000 BYTE),                                                                                                        
  MRC_EXCHANGE_DATE              VARCHAR2(2000 BYTE),                                                                                                        
  MRC_EXCHANGE_RATE              VARCHAR2(2000 BYTE),                                                                                                        
  MRC_EXCHANGE_RATE_TYPE         VARCHAR2(2000 BYTE),
  CASH_RECEIPT_HISTORY_ID_N      NUMBER(15)                                                                                                        
);
